$(document).ready(function() {

  $("[role='slider']").focus( function(event) {
     $(event.target).addClass('focus');
   }  // end focus function
  ) // end focus method

  $("[role='slider']").blur( function(event) {
     $(event.target).removeClass('focus');
   } // end blur function
  ) // end blur method   

  $("[role='slider']").each( function() {
  
     var valuemin  = parseInt($(this).attr('aria-valuemin'));
     var valuemax  = parseInt($(this).attr('aria-valuemax'));
     var valuenow  = parseInt($(this).attr('aria-valuenow'));
     var valuetext = $(this).attr('aria-valuetext');
     
     var slider_width = parseInt($(this).parent().width());
     var thumb_width = parseInt($(this).width()) + 2;
     
     if( valuetext && valuetext.length ) {     
       var left = 500;
     } else {
       var left = Math.round((1000 * (valuenow - valuemin)) / (valuemax - valuemin));
     } // endif    
     
     left = Math.round((left * (slider_width - thumb_width)) / 1000) 

     $(this).css('left', left  + 'px');
     
   } // end blur function
  ) // end blur method   

  } // end each function
) // end each method
